package com.crm.jdy.service.client;

import com.crm.jdy.common.dto.EventInfoDto;
import com.crm.jdy.common.pojo.EventInfo;
import com.crm.jdy.common.mapper.EventInfoMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.dubbo.config.annotation.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**   
 * @Description:(待办事项服务实现)
 *
 * @version: V1.0
 * @author: kong
 * 
 */
@Service(version = "${service.version}")
@Component
public class EventInfoServiceImpl  extends ServiceImpl<EventInfoMapper,EventInfo> implements EventInfoService  {

    @Autowired
    EventInfoMapper eventInfoDao;

    @Override
    public PageInfo<EventInfo> seleteEventInfo(EventInfoDto callAplanInfoDto) {
        PageHelper.startPage( callAplanInfoDto.getCurrentPage(),callAplanInfoDto.getPageSize());
        List<EventInfo> bookList = eventInfoDao.seletePeoductInfo(callAplanInfoDto);
        PageInfo<EventInfo> pageInfo = new PageInfo<EventInfo>(bookList);
        return pageInfo;
    }

    @Override
    public boolean updateEventInfo(EventInfo callAplanInfoDto) {
        return eventInfoDao.updateById(callAplanInfoDto) > 0;
    }

    @Override
    public boolean addEventInfo(EventInfo callAplanInfo) {
        return eventInfoDao.insert(callAplanInfo) > 0;
    }

    @Override
    public boolean removeEventInfo(String proId) {
        return eventInfoDao.deleteById(proId) > 0;
    }
}